package com.neusoft.ch7.hw.test04;

public class ColaEmployee {
	// 属性--成员变量
	// 员工姓名
	private String empName;
	// 员工生日月份
	private int empBirthdayMonth;

	// 行为--成员方法
	/**
	 * 计算生日金
	 * 
	 * @param month
	 *            打印工资的月份
	 * @return 生日金
	 */
	public double getSalary(int month) {
		// 如果当前月是生日月，则补助100生日金
		// Calendar cal = Calendar.getInstance();
		// 当前系统时间月份
		// int month = cal.get(Calendar.MONTH) + 1;
		if (month == empBirthdayMonth) {
			return 100;
		}
		// 父类默认工资为0
		return 0;

	}

	/**
	 * 输出自己工资的行为
	 */
	public void printMySalary(int month) {
		// System.out.println(this.toString());
		System.out.println("员工姓名：" + this.getEmpName() + ",工资：" + this.getSalary(month));
	}

	@Override
	public String toString() {
		return "ColaEmployee [empName=" + empName + ", empBirthdayMonth=" + empBirthdayMonth + "]";
	}

	public ColaEmployee(String empName, int empBirthdayMonth) {
		super();
		this.empName = empName;
		this.empBirthdayMonth = empBirthdayMonth;
	}

	public String getEmpName() {
		return empName;
	}

	public void setEmpName(String empName) {
		this.empName = empName;
	}

	public int getEmpBirthdayMonth() {
		return empBirthdayMonth;
	}

	public void setEmpBirthdayMonth(int empBirthdayMonth) {
		this.empBirthdayMonth = empBirthdayMonth;
	}

	// public static void main(String[] args) {
	// Calendar cal = Calendar.getInstance();
	// int year = cal.get(Calendar.YEAR);
	// int month = cal.get(Calendar.MONTH) + 1;
	//
	// System.out.println(year + " 年 " + month + " 月");
	// }
}
